<?php
// +----------------------------------------------------------------------
// | 幕小铺
// +----------------------------------------------------------------------
// | 版权所有 2016~2020 幕小铺科技（大连）有限公司
// +----------------------------------------------------------------------
// | 2020/06/02
// +----------------------------------------------------------------------

namespace app\erp\validate;

use think\Validate;

/**
 * 公共类 验证器 收藏管理
 * @package app\admin\validate
 * @author dou<51779987@qq.com>
 */
class Collection extends Validate
{
    protected $rule = [
        'user_id'	        =>  'require|number',
        'id'		        =>  'require|number|gt:0',
		'goods_id'		    =>  'require',
        'uid'		        =>  'require'
    ];

    protected $message  =   [
        'user_id' 		    => 'user_id格式错误',
        'id' 			    => 'id格式错误',
        'goods_id.require' 	=> '商品不能为空',
        'uid.require'		=> 'uid格式错误'
    ];

    //验证场景
    protected $scene = [
        'collection_index'=>  [//列表
            'user_id',
        ],
        'collection_add'=>  [//添加
            'user_id',
            'goods_id',
            'uid'
        ],
        'collection_delete'=>  [//删除
            'user_id',
            'id',
        ]
    ];
}
